package vfs.server.config;

import org.xml.sax.SAXException;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import java.io.File;
import java.io.IOException;

/**
 * Reads config file and reports possible problems
 * User: serge
 * Date: 15.11.13
 * Time: 2:29
 */
public class Config
{
    /** default port used by LocateRegistry.getRegistry(hostname) */
    static int listenPort = 1099;

    public static int getListenPort()
    {
        return listenPort;
    }

    public static void parse() throws ParserConfigurationException, SAXException, IOException
    {
        SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
        File configXml = new File("conf.xml");
        parser.parse(configXml, new ConfigHandler());
    }
}
